"Working With Pictures," which begins on Working With Pictures , discusses how applications can display compressed images that are stored as pictures by calling the DrawPicture function. The Image Compression Manager also provides functions that allow your application to display single-frame compressed images. As with image compression, your application can choose to specify all the parameters that govern the operation, or it can leave many of these choices to the Image Compression Manager.
This section describes the steps your application must follow to decompress an image into a pixel map.
First, your application determines where to display the decompressed image. Your application must specify the destination graphics port to the Image Compression Manager. In addition, you may indicate that only a portion of the source image is to be displayed. You describe the desired portion of the image by specifying a rectangle in the coordinate system of the source image. You can determine the size of the source image by examining the image description structure associated with the image (see "The Image Description Structure" for more information about image description structures).
Your application may also specify that the image is to be mapped into the destination graphics port. The Image Compression Manager provides two mechanisms for mapping images during decompression. The DecompressImage function (described on DecompressImage ) accepts a second rectangle as a parameter. During decompression the Image Compression Manager maps the desired image to the destination rectangle, scaling the resulting image as appropriate to fit the destination rectangle. The FDecompressImage function (described on FDecompressImage ) allows your application to specify a mapping matrix for the operation. Currently, the Image Compression Manager supports only scaling and translation matrix operations.
Your application can invoke further effects by specifying a mask region or blend matte for the image. Mask regions and mattes control which pixels in the source image are drawn to the destination. Mask regions define the part of the source image that is displayed. During decompression the Image Compression Manager displays only those pixels in the source image that correspond to bits in the mask that are set to 1. Mask regions must be defined in the destination coordinate system.
Blend mattes contain several bits per pixel and are defined in the coordinate system of the source image. Mattes provide a mechanism for mixing two images. The Image Compression Manager displays the weighted average of the source and destination based on the corresponding pixel in the matte (this feature is fully functional in System 7 and is approximated in System 6).
Decompress the image by calling the Image Compression Manager's DecompressImage or FDecompressImage function. Your application must provide an image description structure along with the other parameters governing the operation. Use the DecompressImage function for simple decompression operations. If your application needs greater control, use the FDecompressImage function. See "Working With Images" which begins on Working With Images , for detailed descriptions of these functions.
The Image Compression Manager manages the decompression operation and invokes the appropriate decompressor component. The manager returns the decompressed image to the location specified by your application.